package com.itheima.controller;

import com.itheima.domain.UserEntity;
import com.itheima.service.MongoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: liminghui
 * @Date: 2020/9/15 21:32
 * @Version:
 * @Description:
 */
@RestController
@RequestMapping("/mongo")
public class MongoController {

    @Autowired
    private MongoService mongoService;

    /***
     * 查询所有用户
     * @return
     */
    @RequestMapping("/find")
    public  List<UserEntity> find() {
        return mongoService.find();
    }
}
